home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWSemEvt / FWAplEvt.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.8 KB  |  108 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWAplEvt.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWAPLEVT_H
  11. #define FWAPLEVT_H
  12.  
  13. #ifndef FWDESC_H
  14. #include "FWDesc.h"
  15. #endif
  16.  
  17. //========================================================================================
  18. //    Forward Declarations
  19. //========================================================================================
  20.  
  21. class ODAppleEvent;
  22. class FW_CPart;
  23. class FW_MScriptable;
  24. class FW_CFrame;
  25.  
  26. //========================================================================================
  27. //    class FW_CAppleEvent
  28. //========================================================================================
  29.  
  30. class FW_CAppleEvent : public FW_CDesc
  31. {
  32. public:
  33.     FW_DECLARE_AUTO(FW_CAppleEvent)
  34.     
  35.     FW_CAppleEvent();
  36.     FW_CAppleEvent(ODAppleEvent* odAppleEvent);
  37.     FW_CAppleEvent(const FW_CPart* part, 
  38.                 ODEventClass eventClass,
  39.                 ODEventID eventID,
  40.                 const FW_CDesc& addressDesc);
  41.  
  42. private:
  43.     FW_CAppleEvent(const FW_CAppleEvent& other);
  44.     
  45. public:
  46.     virtual ~FW_CAppleEvent();
  47.     
  48.     FW_Boolean     HasAttribute(ODDescType key) const;
  49.     
  50.     void        GetAttributeByPtr(ODDescType dataType,
  51.                                 void* dataPtr,
  52.                                 Size* dataSize,
  53.                                 Size maxSize,
  54.                                 AEKeyword key) const;
  55.     
  56.     void        PutAttributeByPtr(ODDescType dataType,
  57.                                 const void* dataPtr,
  58.                                 Size dataSize,
  59.                                 AEKeyword key);
  60.                                 
  61.     void         GetAttributeByDesc(AEKeyword key, 
  62.                                 FW_CDesc& desc, 
  63.                                 ODDescType desiredType = typeWildCard) const;
  64.     void        PutAttributeByDesc(AEKeyword key, const FW_CDesc& desc);
  65.     
  66.     void        GetSubject(FW_CDesc& subjectDesc) const;
  67.     void        SetSubject(const FW_CDesc& subjectDesc);
  68.     
  69.     void        GetTarget(FW_CDesc& targetDesc) const;
  70.     void        SetTarget(const FW_CDesc& targetDesc);
  71.     
  72.     AEKeyword     GetEventClass() const;
  73.     void        SetEventClass(AEKeyword eventClass);
  74.     
  75.     AEKeyword     GetEventID() const;
  76.     void        SetEventID(AEKeyword eventID);
  77.     
  78.     void        SendToSelf(Environment* ev,
  79.                         FW_CFrame* toFrame,
  80.                         FW_CAppleEvent* resultEvent,
  81.                         ODSendPriority sendPriority,
  82.                         ODULong timeOutInTicks);
  83.                         
  84.     operator    ODAppleEvent*() const;
  85.     operator    ODAppleEvent**();
  86.     
  87. protected:
  88.     
  89.     virtual ODDesc* PrivCreateODDesc(Environment* ev) const;
  90.     
  91. private:
  92.     
  93.     short        fReturnID;
  94. };
  95.  
  96. //========================================================================================
  97. //    Utility Functions
  98. //========================================================================================
  99.  
  100. FW_CAppleEvent* FW_MakeSetLocalPropertyEvent(Environment* ev, 
  101.                                 FW_CPart* part, 
  102.                                 FW_MScriptable* theObject,
  103.                                 ODDescType whichProperty,
  104.                                 FW_CDesc& newValue);
  105.  
  106.  
  107. #endif // FWAPLEVT_H
  108.